import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';

@Component({
    selector: 'app-record-list',
    templateUrl: './record-list.component.html',
    // styleUrls: ['./record-list.component.less'],
})
export class RecordListComponent implements OnInit {
    // 该组件接收的数据
    @Input() RecordListData: any[];
    // 点击该组件后向父组件返回的数据
    @Output() ReturnRecordData: EventEmitter<any> = new EventEmitter<any>();


    constructor() {
    }

    // 测试数据
    // recordListData = [
    //     {address: '山东省济南市高新区浪潮软件科技园', time: '2020-03-11 09:53:37'},
    //     {address: '山东省济南市高新区浪潮软件科技园', time: '2020-03-11 09:53:37'},
    //     {address: '山东省济南市高新区浪潮软件科技园', time: '2020-03-11 09:53:37'},
    //     {address: '山东省济南市高新区浪潮软件科技园', time: '2020-03-11 09:53:37'},
    //     {address: '山东省济南市高新区浪潮软件科技园', time: '2020-03-11 09:53:37'},
    //     {address: '山东省济南市高新区浪潮软件科技园', time: '2020-03-11 09:53:37'},
    //     {address: '山东省济南市高新区浪潮软件科技园', time: '2020-03-11 09:53:37'},
    // ];

    ngOnInit() {
    }

    //  点击list返回该条数据
    return(data: any) {
        this.ReturnRecordData.emit(data);
    }
}
